package com.wuyou.threadlocal;

/**
 * StroingRefenenceDemo
 *
 * @Date 2025/9/23 14:41
 * @Author 无忧
 */
public class StringRefenenceDemo {

    public static void main(String[] args) {
        String s1 = "你好";
        String s2 = s1;
        String s3 = new String("你好");
        System.out.println(s1 == s2);
        System.out.println(s1 == s3);
        System.out.println(s2 == s3);

        s1 = null;
        System.gc();
        System.out.println(s1);
        System.out.println(s2);
    }
}
